package com.cloud.code.牛客网;

import java.util.Scanner;

public class Test58 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {

            int n = Integer.parseInt(scanner.nextLine());

            int dfs = dfs(n);

            System.out.println(dfs);
        }


    }

    private static int dfs(int n) {
        if (n == 1) {
            return 1;
        }
        if (n == 2) {
            return 2;
        }
        if (n == 3) {
            return 2;
        }
        return dfs(n - 1) + dfs(n - 3);
    }
}
